package com.itheima.test;

import java.time.Duration;
import java.time.LocalDateTime;

public class Demo_016 {
    public static void main(String[] args) {
        // Duration (应用)
        //public static Duration between(开始时间,结束时间)  计算两个“时间"的间隔
        LocalDateTime localDateTime = LocalDateTime.of(2020,07,
                01,19,38,12);
        LocalDateTime localDateTime1 = LocalDateTime.of(2020,6,
                29,11,1,1);
        Duration between = Duration.between(localDateTime1, localDateTime);
        long l = between.toDays();
        System.out.println(l);
        long l1 = between.toMinutes();
        System.out.println(l1);
        long seconds = between.getSeconds();
        System.out.println(seconds);
        long l2 = between.toHours();
        System.out.println(l2);


    }
}
